class Solution(object):
    def getSmallestString(self, n, k):
        st = []
        for i in range(n):
            if (n - 1 - i) * 26 >= k - 1:
                st.append('a')
                k -= 1
            else:
                t = k - (n - 1 - i) * 26
                k -= t
                st.append(chr(ord('a') + t - 1))
        return ''.join(st)